<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
%>

<!--  2010-07-26 修改年级信息 -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
	<title>修改年级名称</title>
	<link href="<%=path %>/css/index_css.css" rel="stylesheet" type="text/css" />
	<script language="javascript" src="<%=path %>/js/syAjax.js"></script>
	<script src="<%=path%>/dwr/engine.js"></script>
	<script src="<%=path%>/dwr/util.js"></script>
	<script src="<%=path%>/dwr/interface/shiyueDwr.js"></script>
	<script type="text/javascript">
	function checkForm()
	{
		var gradeName=document.getElementById('gradeName').value;
		var stageName=document.getElementById('stageName').value;
		var gradeSort = document.getElementById('gradeSort').value;
		if(gradeName=="")
		{
			alert("年级名称不能为空！");
			return;
		}
		else if(stageName=="")
		{
			alert("所属学段不能为空！");
			return;
		}
		syAjax.request("post","<%=path %>/addGradeGradeAndClassAction.action","grade.gradeId=${requestScope.GRADE.gradeId}&grade.name="+gradeName+"&grade.stageId="+stageName+"&grade.status=${requestScope.GRADE.status}&grade.sort="+gradeSort+"&grade.deleteTime=${requestScope.GRADE.deleteTime}&t="+new Date(),{success:initSuccessResult,fail:onFail,type:'plain'});
	}
	
	function initSuccessResult(response){
	  window.returnValue=response;
	  window.close();
	}
	
	function getAllSchoolStageCallBack(yearMap) {
    DWRUtil.addOptions("stageName", yearMap);
    if('${requestScope.GRADE.stageId}'!="")
   	{
   	  document.getElementById('stageName').value="${requestScope.GRADE.stageId}";
   	}
    }
    
    function load()
    {
    	shiyueDwr.getAllSchoolStage(1,getAllSchoolStageCallBack);
    }
	</script>
</head>

<body bgcolor="#ECE9D8" onload="load();">
<table width="350" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td align="left" valign="bottom" bgcolor="#ECE9D8" class="f_8">&nbsp;&nbsp;&nbsp;</td>
  </tr>
  <tr>
    <td align="center" valign="top" bgcolor="#ECE9D8"><table width="95%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="1" bgcolor="#ABA899"></td>
      </tr>
      <tr>
        <td height="1" bgcolor="#FFFFFF"></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td align="left" valign="top" bgcolor="#ECE9D8"><table width="100%" border="0" cellspacing="0" cellpadding="0">
     <tr>
        <td width="25%" height="30" align="right">序号：</td>
        <td width="75%" align="left">
        <input name="grade.sort" id="gradeSort" type="text" size="25" maxlength="25" value="${requestScope.GRADE.sort}"/>
        </td>
      </tr>
      <tr>
        <td width="25%" height="30" align="right">年级名称：</td>
        <td width="75%" align="left">
        <input name="grade.name" id="gradeName" type="text" size="25" maxlength="25" value="${requestScope.GRADE.name}"/>
        </td>
      </tr>
      <tr>
        <td width="25%" height="30" align="right">所属学段：</td>
        <td width="75%" align="left"><select id="stageName"></select></td>
      </tr>
    </table>
    </td>
  </tr>
  
  <tr>
    <td height="15" align="center" valign="middle" bgcolor="#ECE9D8"><table width="95%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="1" bgcolor="#ABA899"></td>
      </tr>
      <tr>
        <td height="1" bgcolor="#FFFFFF"></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="25" align="center" valign="middle" bgcolor="#ECE9D8"><input type="button" onclick="checkForm();" name="Submit" value="提 交" /></td>
  </tr>
</table>
</body>
</html>